package leetcode.offer101;

public class Solution extends Offer101 {

	@Override
	public int fib(int n) {
		if (n == 0)
			return 0;
		if (n == 1)
			return 1;
		int a = 0;
		int b = 1;
		int c = 0;
		for (int i = 2; i <= n; i++) {
			c = a + b;
			a = b;
			b = c % 1000_000_007;
		}
		return b;
	}

	public static void main(String[] args) {
		Solution solution = new Solution();
		solution.debug1();
		solution.debug2();
		int r = solution.fib(48);//45
		System.out.println(r);
		System.out.println(r % 1000_000_007);
	}

}
